//
//  ViewController.m
//  ADVIEW
//
//  Created by Burn on 2019/1/8.
//  Copyright © 2019 nmgxysh. All rights reserved.
//

#import "ViewController.h"

#import "TestModel.h"
#import "ADVIEW-Swift.h"
@interface ViewController ()<BRScrollAdViewDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    BRScrollAdView *br = [[BRScrollAdView alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 250) loadImage:^(UIImageView * imageView, NSURL * url) {
        imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"%@",url]];
    }];
    
    
    TestModel *model1 = [[TestModel alloc]init];
    model1.adImageURL = [NSURL URLWithString:@"5.jpeg"];
    
    TestModel *model2 = [[TestModel alloc]init];
    model2.adImageURL = [NSURL URLWithString:@"6.jpeg"];
    
    TestModel *model3 = [[TestModel alloc]init];
    model3.adImageURL = [NSURL URLWithString:@"7.jpeg"];
    
    [br setPicModelsWithPicModels:@[model1,model2,model3]];
    
    br.delegate = self;
    [self.view addSubview:br];
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


- (void)adPicViewClickPicModelWithPictrueModel:(id<BRScrollAdViewProtocol> _Nonnull)pictrueModel {
    TestModel *model = (TestModel *)pictrueModel;
    NSLog(@"%@",model.adImageURL);
}

- (void)adPicViewDidSelectedPicModelWithPictrueModel:(id<BRScrollAdViewProtocol> _Nonnull)pictrueModel {
    
}



@end
